<template>
  <div style="width:100%;overflow-x:hidden">
    <weui-grid :list="grid_0_list" @on-click="on_grid_0_click"></weui-grid>
  </div>
</template>

<script>
  import WeuiGrid from '../vue2componentSet/src/components/WeuiGrid'
  import browserDetect from '../lib/browserDetect'

  export default {
    components: {
      WeuiGrid
    },
    data() {
      return {
        grid_0_list: [{
          label: '京东'
        }]
      }
    },
    mounted() {
      this.$store.commit('set_title', 'tool')
    },
    methods: {
      on_grid_0_click(index) {
//        var redirect_uri = location.protocol + '//' + location.hostname
        var redirect_uri = 'http://etourly.com'
        var link = 'https://oauth.jd.com/oauth/authorize?response_type=code&client_id=6604000BF0481A8D13C0F62E5D37FB45&redirect_uri=' + redirect_uri + '&state=jd'
        if (0 && browserDetect().Safari) {
          location.href = link
        } else {
          const node = document.getElementById('open-url')
          node.href = link
          node.click()
        }
      }
    }
  }
</script>
